var Env_Var_Abstract = Class.create();
Env_Var_Abstract.construct = function() {
    ////this.publicMember = null;		// use "this" to define public member
    ////var privateMember = null;       // use "var" to define private member

	var pathStr = null;
	var shell = null;

 
    // define initialize method
    this.initialize = function(regPath) {
		this.regPath = regPath;
    }

    this.toString = function() {
        return this.getVal();
    }
	
	this.getVal = function() {
		var rtn = '';
		var shell = this.getShell();
		try {
			rtn= shell.RegRead(this.makVarPath(key));
		} catch (e) {
			rtn = '';
		}
		return rtn;
	}


	this.add = function (key, val) {
		////if (!this.exists(key)) {
			this._add(key, val);
		////}
	}

	this._add  = function (key, val) {
		//WScript.Echo(this.makVarPath(key)); 
		//WScript.Echo(val); 
		var shell = this.getShell();
		shell.RegWrite(this.makVarPath(key), val);
	}

	this.exists = function (key) {
		var rtn = true;
		var shell = this.getShell();
		try {
			var val = shell.RegRead(this.makVarPath(key));
		} catch (e) {
			rtn = false;
		}
		return rtn;
	}

	this.makVarPath = function(key) {
		return this.regPath + "\\" + key;
	}

	this.getShell = function() {
		if(!this.shell) {
			this.shell = WScript.CreateObject("WScript.Shell");
		}
		return this.shell;
	}


}
Class.register(Env_Var_Abstract, 'Env.Var.Abstract');
Env_Var_Abstract = null;


